package com.example.administrator.a33;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import java.time.Instant;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button btn_linear = (Button) findViewById(R.id.btn_Linear);//线性布局
        Button btn_frame = (Button) findViewById(R.id.btn_Frame);//帧布局
        Button btn_relative = (Button) findViewById(R.id.btn_Relative);//相对布局
        Button btn_percent = (Button) findViewById(R.id.btn_Percent);//百分百布局

        btn_linear.setOnClickListener(this);
        btn_frame.setOnClickListener(this);
        btn_relative.setOnClickListener(this);
        btn_percent.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_Linear:
                Intent intent1 = new Intent(MainActivity.this, Linear_test.class);
                startActivity(intent1);
                break;
            case R.id.btn_Frame:
                Intent intent2 = new Intent(MainActivity.this, Frame_test.class);
                startActivity(intent2);
                break;
            case R.id.btn_Relative:
                Intent intent3 = new Intent(MainActivity.this, Relative_test.class);
                startActivity(intent3);
                break;
            case R.id.btn_Percent:
                Intent intent4 = new Intent(MainActivity.this, Percent_test.class);
                startActivity(intent4);
                break;

        }
    }
}
